package controller

import (
	. "gddgame.cc/galaxy/common/dsl/web"
	"gddgame.cc/galaxy/core/models"
	"gddgame.cc/galaxy/utils/def"
)

func SubmitFeedback(context def.Context, app *models.App, userOpen *models.UserOpen, message string) error {
	var err error
	if _, err = models.AppFeedbackModel.Query().Save(true, &models.AppFeedback{
		UserId:  userOpen.UserId,
		AppId:   app.Id,
		Message: message,
	}); err != nil {
		return SystemExceptionDetail("Submit Feedback Fail", err)
	}
	return nil
}
